﻿using Newtonsoft.Json;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Text;

namespace PeiYue.Model.Dto.Purchase
{

    public class SearchERPPurchaseDetailDTO
    {

        /// <summary>
        /// 要求送货日期
        /// </summary>
        public DateTime DeliveryDate { get; set; } = DateTime.Now.Date;

        /// <summary>
        ///  客户编号
        /// </summary>
        public string CustomerCode { get; set; }
        /// <summary>
        /// 存货ID
        /// </summary>
        public int CategoryId { get; set; }
        /// <summary>
        /// 供应商编号
        /// </summary>
        public string SupplierCode { get; set; }
        public string Supplier { get; set; }
        public string SupplierMarket { get; set; }
        /// <summary>
        /// 存货编码
        /// </summary>
        public string SkuCode { get; set; }
        public string SaleId { get; set; }
        public string BarCode { get; set; }
        public string ScanCode { get; set; }
        public int ScanUser { get; set; }
        ///// <summary>
        ///// 订单状态
        ///// </summary>
        //public string OrderStatus { get; set; }
    }
    public class ERPPurchaseDetailDTO
    {


        public int Id { get; set; }
        public int fID { get; set; }
        /// <summary>
        /// 存货编码
        /// </summary>
        public string SkuCode { get; set; }
        /// <summary>
        /// 单号
        /// </summary>
        public string OrderId { get; set; }

        /// <summary>
        /// 要求送货日期
        /// </summary>
        public string DeliveryDate { get; set; }

        /// <summary>
        /// 供应商编号
        /// </summary>
        public string SupplierCode { get; set; }
        /// <summary>
        /// 供应商
        /// </summary>
        public string SupplierName { get; set; }

        /// <summary>
        /// 客户编号
        /// </summary>
        public string CustomerCode { get; set; }
        /// <summary>
        /// 客户
        /// </summary>
        public string CustomerName { get; set; }

        /// <summary>
        /// 存货ID
        /// </summary>
        public int CategoryId { get; set; }

        /// <summary>
        /// 品名
        /// </summary>
        public string SkuName { get; set; }
        /// <summary>
        /// 规格
        /// </summary>
        public string SkuSpec { get; set; }

        /// <summary>
        /// 采购数量
        /// </summary>
        public decimal? PurchaseQty { get; set; }

        /// <summary>
        /// 采购计量
        /// </summary>
        public string PurchaseUnit { get; set; }

        /// <summary>
        /// 采购单价
        /// </summary>
        public decimal PurchasePrice { get; set; }

        /// <summary>
        /// 金额
        /// </summary>
        public decimal Amt { get; set; }
        /// <summary>
        /// 报货金额
        /// </summary>
        public decimal AnswerAmt { get; set; }

        /// <summary>
        /// 加工要求
        /// </summary>
        public string Machining { get; set; }

        /// <summary>
        /// 客户优先级
        /// </summary>
        public string CustomerPriority { get; set; }
        /// <summary>
        /// 报货数量 
        /// </summary>
        public decimal AnswerQty { get; set; }
        /// <summary>
        /// 数量
        /// </summary>
        public decimal Qty { get; set; }
        /// <summary>
        /// 已扫描数量
        /// </summary>
        public decimal ReceiptQty { get; set; }

        /// <summary>
        /// 称重状态 1-分拣完成; 2-缺货 
        /// </summary>
        public int Flag { get; set; }

        public int PackQty { get; set; }

        public string SaleId { get; set; }
        /// <summary>
        /// 行号
        /// </summary>
        public int LineNumber { get; set; }
        public string PinYin { get; set; }
        public string OrderQty { get; set; }
        public DateTime? BillDate { get; set; }//账单日期
        public string StrBillDate { get { return BillDate == null ? "" : DateTime.Parse(BillDate.ToString()).ToString("yyyy-MM-dd"); } }//账单日期

        public string BarCode { get; set; }

        /// <summary>
        /// 包裹s
        /// </summary>
        public ICollection<decimal> Qtys { get; set; }
        [JsonConverter(typeof(DateTimeFormat))]
        public DateTime? ScanDate { get; set; }//收货日期

        public int CustomerId { get; set; }
        /// <summary>
        /// 收货人
        /// </summary>
        public string ReceiptUser { get; set; }
        /// <summary>
        /// 收货人ID
        /// </summary>
        public long UpdateUser { get; set; }
        public int Status { get; set; }
    }
}
